﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html style="height: 100%;">
<head>
    <meta charset="utf-8">
    <title>考试平台</title>
    <link rel="shortcut icon" href="/account/static/newVersion/images/examstar_icon.ico" />
    <link href="~/Content/Logincss1.css" rel="stylesheet" />
    <link href="~/Content/Logincss2.css" rel="stylesheet" />
</head>

<body id="login" style="height: 100%; margin: 0;">
    <div class="login-wrap">
        <div class="left-pic">
            <img src="~/img/login-reg-pic.jpg" />
        </div>
        <div class="right-content">
            <img src="~/img/11.png" alt="logo" class="logo" />
            @*<form method="post" action="/Home/LoginPage">*@
            <div name="form_wm" class="login-form">
                <div class="main-error-tips" id="errormsg"></div>
                <div class="username">
                    <input type="text" name="user_name_input" id="txtname" placeholder="账号">
                </div>
                <div class="password">
                    <input type="password" name="password" id="txtpwd" placeholder="密码">
                </div>
                <div class="remember">
                    <label for="saveUsername"><input type="checkbox" id="saveUsername" name="auto_login" style="vertical-align: middle">7天自动登录</label>
                    <a href="/account/find_pwd" class="forget-password">忘记密码<em class="icon icon-help" style="margin-left: 5px"></em></a>
                </div>
                <a href="#" class="btn btn-login" onclick="xuesheng()">登录</a>

                <a href="/regist" class="btn btn-regist">注册</a>

            </div>
            @*</form>*@
            <div class="login-on-phone">
                <div class="qr-code-wrap"><div class="qr-codes"></div></div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        DivLoads(true);//显示系统运行等待层
    </script>
    <script>
        var delayTime = 5;//等待多少秒
        function counter() {
            DivLoads(false);//隐藏系统运行等待层
        }
        setTimeout("counter()", 5 * 5000);
    </script>
    <script src="~/Scripts/jquery.min.js"></script>
    <script src="~/Scripts/Jquery.qrcode.min.js"></script>
    <script type="text/javascript">

        $(".qr-codes").qrcode({
            size: 120,
            minVersion: 3,
            fill: "#000",
            background: "#fff",
            text: window.location.href,
            radius: 0,
            quiet: 2,
        });
    </script>

</body>
</html>

<script>
    function xuesheng()
    {
        if ($("#txtname").val() == "" || $("#txtname").val() == null)
        {
            alert('用户名不能为空');
            return;
        }
        if ($("#txtpwd").val() == "" || $("#txtpwd").val() == null) {
            alert('密码不能为空');
            return;
        }
        else {
            $.ajax({
                type: "get",
                url: "/Home/LoginDO",
                data: { U_ID: $("#txtname").val(), U_Pwd: $("#txtpwd").val() },
                success: function (obj) {
                    if (obj == 1)
                    {
                        alert('学生登陆成功');
                        location.href = "/Home/Student_shouye";
                        return;
                    }
                    if (obj == 2) {
                        alert('老师登陆成功');
                        location.href = "/Home/Teacher_CuotiPage";
                        return;
                    }
                    if (obj == 3) {
                        alert('管理员登陆成功');
                        location.href = "/Home/Admin_Yishengcheng";
                        return;
                    }
                    else {
                        alert('用户不存在');
                        return;
                    }
                }
            })
        }
    }
</script>